<%@ page contentType="text/html; charset=UTF-8"%>
<%@page pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ page import="sunsite.tools.*,java.util.*" %>
<%  String serverPath = Path.getServerUrl(request);%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>Sun SITE</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="css/main.css" rel="stylesheet" type="text/css" />
        <link href="css/new.css" rel="stylesheet" type="text/css" />
        <script src="js/user.js"></script>
        <script langauge="JavaScript" type="text/javascript">
            function checkForm()
            {
                var e = self.window.document.getElementById("txt_name");
                if(e) if(e.value == "")
                {
                    alert("<s:text name="message.nameError"/>");
                    e.focus();
                    return false;
                }

                var e = self.window.document.getElementById("txt_email");
                if(e)
                {
                    if(e.value == "")
                    {
                        alert("<s:text name="message.mailError"/>");
                        e.focus();
                        return false;
                    }
                    else if(e.value.indexOf("@") < 0)
                    {
                        alert("<s:text name="message.mailError2"/>");
                        e.select();
                        return false;
                    }
                }
                var e = self.window.document.getElementById("txt_content");
                if(e) if(e.value == "")
                {
                    alert("<s:text name="message.contentError"/>");
                    e.focus();
                    return false;
                }

                return true;
            }
        </script>
    </head>

    <body>
        <div class="bk8_c_t">
            <img src="images/tab_l_h.gif" alt="" />
            <div class="tab_h" id="top"><a><s:text name="message.title"/></a></div>
            <img src="images/tab_r_h.gif" alt="" />
        </div>
        <div class="bk9_c_b_t">
            <img style="float:left" src="images/frame_l_2.gif" alt="" />
            <div class="bk9_c_b_t_m">
                <div class="bk9_c_b_t_m_l">

                </div>
                <div class="bk9_c_b_t_m_r"><a href="#leaveMsg"><s:text name="message.postTile"/></a></div>
            </div>
            <img style="float:right" src="images/frame_r_2.gif" alt="" />
        </div>
        <div class="bk8_c_b_m" style="background:none">
            <div class="border" style="float:left"></div>
            <div class="border" style="float:right"></div>
            <s:iterator value="messages">
                <div class="bk9_c_b_m_t">
                    <div class="bk9_c_b_m_t_l"><a class="bk9_c_b_m_t_l_l" href="">
                        <s:property value="mesName" /></a>
                        <a class="bk9_c_b_m_t_l_r" href="mailto:<s:property value="mesEmail" />">
                            (<s:property value="mesEmail" />)
                        </a>
                        ip: <s:property value="mesIp" />
                    </div>
                    <div style="float:right"><s:property value="mesTime" /></div>
                </div>
                <div class="bk9_c_b_m_m">
                    <s:property value="mesContent"/>
                </div>
                <div class="bk9_c_b_m_b"><a href="#top"><img src="images/btn_top.gif" alt="" /></a></div>
            </s:iterator>
            <div class="clear"></div>
        </div>
        <div class="bk9_c_b_b">
            <img style="float:left" src="images/frame_b_l_3.gif" alt="" />
            <div class="bk9_c_b_t_m_l" style="margin-top:5px">
                <s:bean name="org.apache.struts2.util.Counter" id="counter">
                    <s:param name="first" value="1"/>
                    <s:param name="last" value="#request.pageCount"/>
                </s:bean>

                <s:iterator value="counter">
                    <s:url id="getNextPage" action="message">
                        <s:param name="pageNow"><s:property/></s:param>
                    </s:url>
                    <s:a href="%{getNextPage}"><s:property/></s:a>&nbsp;
                </s:iterator>
            </div>
            <img style="float:right" src="images/frame_b_r_3.gif" alt="" />
        </div>
        <div class="bk9_c_b_b_2" id="leaveMsg">
            <form action="postMessage.action" method="POST">
                <div class="bk9_c_b_b_2_t"><s:text name="message.welcome"/></div>
                <div class="bk9_c_b_b_2_m">
                    <s:text name="message.name"/><input type="text" id="txt_name" name="name"/>
                <s:text name="message.email"/><input type="text" id="txt_email" name="email" /></div>
                <div class="bk9_c_b_b_2_b"><s:text name="message.content"/><textarea id="txt_content" name="content"></textarea> </div>
                <div class="bk9_c_b_b_2_b_b"><s:text name="message.verifyCode"/><input name="verifyCode" type="text" maxlength="6" size="6">
                    <img id="verifyCodeImageRegister" src='<%=Path.getServerUrl(request)%>tools/verifyCode.jsp?width=80&heigth=24'/>
                    <a href="#" onclick='return getVerifyCode("verifyCodeImageRegister","<%=Path.getServerUrl(request)%>");'><font size="2" > <s:text name="message.refreshCode"/></font></a>
                <input style="" type="submit" value="<s:text name="submit"/>" onclick="return checkForm();"/><input style="" type="reset" value="<s:text name="reset"/>" /><s:property value="message"/></div>
            </form>
        </div>
    </body>
</html>
